﻿using Microsoft.AspNetCore.Mvc;
using WMSUIMVC.DTO.Injure;
using XuanKeZz.Application.HTTP;

namespace WMSUIMVC.Controllers
{

    /// <summary>
    /// 仓库作业
    /// </summary>
    public class ChartController : Controller
    {
        private readonly IConfiguration configuration;

        public ChartController(IConfiguration configuration)
        {
            this.configuration = configuration;
        }

        public IActionResult Index()
        {
            return View();
        }

        public IActionResult WarehouseList()
        {
            return View();
        }

        /// <summary>
        /// 显示入库的图表
        /// </summary>
        /// <param name="model"></param>
        /// <param name="pindex"></param>
        /// <param name="psize"></param>
        /// <returns></returns>
        public async Task<IActionResult> GetStorage(string Token)
        {
            HttpClientWrapper client = new HttpClientWrapper(Token);
            string url = configuration["Url"] + "ckd/api/Chart/GetStorageList";
            string res = await client.GetAsync(url);
            return Json(res);
        }


        /// <summary>
        /// 显示出库的图表
        /// </summary>
        /// <param name="model"></param>
        /// <param name="pindex"></param>
        /// <param name="psize"></param>
        /// <returns></returns>
        public async Task<IActionResult> GetOutbound(string Token)
        {
            HttpClientWrapper client = new HttpClientWrapper(Token);
            string url = configuration["Url"] + "ckd/api/Chart/GetOutboundList";
            string res = await client.GetAsync(url);
            return Json(res);
        }

        /// <summary>
        /// 显示盘点的图表
        /// </summary>
        /// <param name="model"></param>
        /// <param name="pindex"></param>
        /// <param name="psize"></param>
        /// <returns></returns>
        public async Task<IActionResult> GetInventory(string Token)
        {
            HttpClientWrapper client = new HttpClientWrapper(Token);
            string url = configuration["Url"] + "ckd/api/Chart/GetInventoryList";
            string res = await client.GetAsync(url);
            return Json(res);
        }

        /// <summary>
        /// 显示调拨的图表
        /// </summary>
        /// <param name="model"></param>
        /// <param name="pindex"></param>
        /// <param name="psize"></param>
        /// <returns></returns>
        public async Task<IActionResult> GetAllocate(string Token)
        {
            HttpClientWrapper client = new HttpClientWrapper(Token);
            string url = configuration["Url"] + "ckd/api/Chart/GetAllocateList";
            string res = await client.GetAsync(url);
            return Json(res);
        }



    }
}
